function select(ligne) {
	var form = document.getElementById('listForm');
	var input = form.getElementsByTagName('input');
	
	var submit = -1; while (++submit < input.length &&
		input[submit].getAttribute('type') != 'submit');
	if (submit >= input.length) return alert('No submit?');
	submit = input[submit]; input = input[0];
	
	if (input.value) {
		var row = document.getElementById(input.value);
		row.style.background = 'transparent';
	}
	
	if (input.value = ligne) {
		var row = document.getElementById(input.value);
		row.style.background = 'rgb(13, 55, 134)';
		submit.disabled = false;
	} else	submit.disabled = true;
}

function updateList(list, page, onUpdate) {
	var frame = document.createElement('iframe');
	frame.setAttribute("style", "display: none;" +
			"visibility: hidden; margin: 0 -100% 0 0;" +
			"position: absolute; top: -5000px; height: 100px");
	frame.id = "updateList_" + list;
	
	frame.setAttribute("onload",
		"var __updList_list = document.getElementById('" + list + "');" +
		"var __updList_iBdy = frames['updateList_" + list + "'].document;" +
		"if (!__updList_iBdy || !__updList_iBdy.body) {" +
			"__updList_list.innerHTML = \"" +
			"Impossible de joindre le serveur...\"; return;" +
		"}else __updList_iBdy = __updList_iBdy.body;" +
		
		"if (__updList_iBdy.innerHTML) {" +
			"var source = __updList_iBdy, target = __updList_list;" + onUpdate +
		"setTimeout(\"" + // wait before reloading new contents
			"var iFrm = document.getElementById('updateList_" + list + "');" +
			"var path = iFrm.src.split('&timestamp=')[0];" +
			"iFrm.src = path + '&timestamp=' + new Date().getTime();" +
		"\", 2000);} else __updList_list.innerHTML = \"" +
		"Vous avez &eacute;t&eacute; d&eacute;connect&eacute;\";");
	
	frame.src = location.href.substring(0,
		location.href.lastIndexOf('/') + 1) +
		page + (!~page.indexOf('?')?'?':'');
	document.getElementById(list).innerHTML =
		'Chargement de la liste... Veuillez patienter';
	document.body.appendChild(frame);
}
